import numpy as np

def labelAndSample(y_train):
    y_labels = []
    y_sample = []
    for _, v in enumerate(y_train):
        listClassAndSample = str(v).replace("{", "").replace("}", "").replace("'", "").replace(" ", "").strip().split(",")
        if listClassAndSample[0] == "n":
            y_labels.append(0)
            y_sample.append(listClassAndSample[1])
        if listClassAndSample[0] == "a":
            y_labels.append(1)
            y_sample.append(listClassAndSample[1])
        if listClassAndSample[0] == "c":
            y_labels.append(2)
            y_sample.append(listClassAndSample[1])
        if listClassAndSample[1] == "n":
            y_labels.append(0)
            y_sample.append(listClassAndSample[0])
        if listClassAndSample[1] == "a":
            y_labels.append(1)
            y_sample.append(listClassAndSample[0])
        if listClassAndSample[1] == "c":
            y_labels.append(2)
            y_sample.append(listClassAndSample[0])
    return np.array(y_labels),y_sample